package io.characterStream.bufferedRorW;

import java.io.*;

public class BufferedStreamDemo2 {
    public static void main(String[] args) throws IOException {
        //拷贝文件
        BufferedReader br = new BufferedReader(new FileReader("HDay08\\A.txt"));
        BufferedWriter bw = new BufferedWriter(new FileWriter("HDay08\\B.txt"));
        String line;
        while((line = br.readLine())!=null){
            bw.write(line);
            //写入换行符
            bw.newLine();
        }
        br.close();
        bw.close();
    }

    private static void method1() throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("HDay09\\A.txt"));
        //一次读取一整行
        String line;
        while((line = br.readLine())!=null){
            System.out.println(line);
        }
        br.close();
    }
}
